"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
/**
 * 使用装饰器实现代码高亮
 *  这个也是复习装饰器的一课
 */
{
    const hightLight = (target, propertyKey, descriptor) => {
        let code = descriptor.value(); // 先存下值
        descriptor.value = () => {
            return `<div style="color:red">${code}</div>`;
        };
    };
    class User {
        code() {
            return 'Jimmy Codeing';
        }
    }
    __decorate([
        hightLight,
        __metadata("design:type", Function),
        __metadata("design:paramtypes", []),
        __metadata("design:returntype", void 0)
    ], User.prototype, "code", null);
    console.log(new User().code()); // <div style="color:red">Jimmy Codeing</div>
    /**
     * <div style="color:red">Jimmy Codeing</div>
     *
     * 可以看见 我们的代码已经默认的被div标签包裹起来了
     *  并且加上了红色字的样式
     *  这就是个demo 主要是复习怎么使用方法装饰器
     */
}
